home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
GSRC208A.ZIP
/
GEP2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-07
|
35KB
|
1,131 lines
#include "copyleft.h"
/*
GEPASI - a simulator of metabolic pathways and other dynamical systems
Copyright (C) 1989, 1992, 1993 Pedro Mendes
*/
/*************************************/
/* */
/* GWSIM - Simulation */
/* MS-WINDOWS front end */
/* */
/* Initialization and some */
/* data structures */
/* */
/* QuickC/WIN 1.0 */
/* */
/* (include here compilers that */
/* compiled GWSIM successfully) */
/* */
/*************************************/
#include <windows.h>
#include <string.h>
#include <float.h>
#include "globals.h"
#include "gaussw.h"
#include "strtbl.h"
#include "simgvar.h"
void get_dfts( void );
struct kint {
unsigned char nconst;
unsigned char nmodf;
LPSTR descr;
LPSTR constnam;
};
struct nodet{
char item;
unsigned char val;
unsigned char left;
unsigned char right;
};
struct treet{
struct nodet node[256];
char id[64][10];
float constant[32];
int nnode,
nnum,
nid,
nsub,
npro,
nmodf,
nconst,
revers;
char descr[64];
};
struct opt {
int dyn;
long pfo;
double endtime;
double reltol;
double abstol;
double hrcz;
int adams;
int bdf;
int ss;
int debug;
int txt;
int structan;
int staban;
int stdela;
int nonela;
int stdcc;
int noncc;
int dat;
int datsep;
int datwidth;
int dattit;
int datmca;
int datss;
int quotes;
int append;
char timeu[32];
char concu[32];
int scan;
int scanlog;
unsigned long scandens;
};
struct plt{
int type; /* 0 for 2d, 1 for 3d */
int file; /* 0 for dynamics, 1 for steady state */
int x; /* column for x */
int y[10]; /* columns for y */
int z; /* column for z */
int ny; /* number of y variables */
int logx; /* 1 if log x axis */
int logy; /* 1 if log y axis */
int logz; /* 1 if log z axis */
int lines; /* 1 if points connected by lines */
int colour; /* 1 if colour to be used */
int hidden; /* 1 if hidden line removal */
int contour; /* 1 if contour plots on base */
};
struct ou {
LPSTR title;
unsigned int idx;
};
struct sp{
int idx;
LPSTR title;
double low;
double high;
unsigned long dens;
int log;
int lidx;
int linkedto;
double factor;
int operation;
};
GLOBALHANDLE hMetname; /* handle to memory block w/ metname */
GLOBALHANDLE hStepname; /* handle to memory block w/ stepname */
GLOBALHANDLE hStoiu; /* handle to memory block w/ stoiu */
GLOBALHANDLE hSto; /* handle to memory block w/ stoi */
GLOBALHANDLE hLoop; /* handle to memory block w/ loop */
GLOBALHANDLE hParams; /* handle to memory block w/ params */
GLOBALHANDLE hKtype; /* handle to memory block w/ ktype */
GLOBALHANDLE hRstr; /* handle to memory block w/ rstr */
GLOBALHANDLE hOutpEl; /* handle to memory block w/ outpel */
GLOBALHANDLE hStrPool; /* handle to memory block w/ strings */
GLOBALHANDLE hScanPar; /* handle to memory block w/ strings */
GLOBALHANDLE hTree; /* handle to memory block w/ trees */
GLOBALHANDLE hTreeStr; /* handle to memory block w/ tree str */
GLOBALHANDLE hTmpF; /* handle to memory block w/ temp files */
char (huge *metname)[NAME_L]; /* pointer to work with metname array */
char (huge *stepname)[NAME_L]; /* metabolite names */
int huge *stoiu; /* pointer to work with stoiu array */
int huge *stoi; /* pointer to work with stoi array */
unsigned char (huge *loop)[MAX_STEP][MAX_MET]; /* def. of modification loops */
int (huge *rstr)[MAX_STEP][MAX_MOL]; /* reaction structure */
char topname[256]; /* title for the topology */
char stepstr[MAX_STEP][256]; /* array to hold description of steps */
double huge *params[MAX_STEP]; /* ptr to parameters for each rate eq. */
DWORD sizeparam; /* size of parameters memory block */
DWORD sizeoutp; /* size of outpel memory block */
DWORD sizestrp; /* size of StrPool memory block */
DWORD sizestra; /* size of allocated strings in StrPool */
DWORD sizespar;
DWORD sizetr; /* size of allocated strings in TreeStr */
double xu[MAX_MET]; /* metabolite concentrations */
double moiety[MAX_MET]; /* concentration of conserved moieties */
int intmet[MAX_MET]; /* 1 if internal metabolite */
unsigned char revers[MAX_STEP]; /* 1 if reaction is reversible */
int kinetu[MAX_STEP]; /* type of kinetics (user numb.) */
int kfl[MAX_STEP]; /* flags for input of user-def.kinetics */
LPSTR strpool; /* points to the string pool mem block */
LPSTR treestr; /* points to the tree string pool */
LPSTR treeptr; /* points to the tree string pool */
struct opt options; /* structure with simulation options */
struct plt plot; /* structure with plot options */
struct kint huge *ktype; /* ptr array of kinetic types & proprt */
struct ou huge *outpel; /* ptr array of output elements */
struct sp huge *spar; /* ptr array of scanning elements */
float ver_no; /* .top and .sim version number */
double dft_endtime; /* time value for last iteration */
double dft_hrcz; /* highest rate considered zero */
int totmet; /* number of total metabolites */
int nmetab; /* number of internal metabolites */
int indmet; /* number of independent metabolites */
int nextmet; /* number of external metabolites */
int nsteps; /* number of steps */
int nloops; /* number of modifier loops */
int noutpel; /* number of output elements */
int nudf; /* number of user-defined functions */
int nrateq; /* number of user-defined functions */
int totsel; /* number of selected output elements */
int totscan; /* number of dimensions to scan */
int nscanpar; /* number of scanning elements */
int nlinks; /* number of links between parameters */
unsigned char dft_debugval; /* debug mode */
double dft_conc; /* default metabolite concentration */
double dft_const; /* default value for kinetic constants */
char *dft_timeu; /* default time units */
char *dft_concu; /* default conctration units */
unsigned long dft_pfo; /* number of points for output */
struct treet huge *tree; /* function tree for rate equations */
struct treet tr; /* tree for the input */
LPSTR TmpFiles; /* string holding names of temp files */
int InitGepasiVar( void );
void TidyGepasiVar( void );
int SetParams( void );
int SetOutpEl( void );
void step_string( void );
void conc_dft( void );
void numer_dft( void );
void def_def( void );
void set_dfts( void );
void get_dfts( void );
#pragma alloc_text( CODE1, InitGepasiVar, TidyGepasiV